package cn.johnyu.product.controller;

import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.lang.management.ManagementFactory;
import java.util.concurrent.TimeUnit;

@RestController
public class ProductController {
    @GetMapping("/info")
    public String info(){
//        try {
//            TimeUnit.MILLISECONDS.sleep(3000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        String processInfo = ManagementFactory.getRuntimeMXBean().getName();
        String threadInfo = Thread.currentThread().getName();

        return "product: "+processInfo+":::"+threadInfo;
    }
}
